<template>
  <div class="form-item-panel" :style="Object.assign({marginTop: title || this.$slots['title'] ? '' : '10px'}, cssObj)">
    <div v-if="title || this.$slots['title']" class="title-wrapper"><slot name="title">{{title}}</slot></div>
    <slot></slot>
  </div>
</template>

<script>
  export default {
    name: 'FormItemPanel',
    props: {
      title: {
        type: String
      },
      cssObj: {
        type: Object,
        default: function () {
          return {}
        }
      }
    },
    data() {
      return {}
    },
    mounted() {

    },
    methods: {},
    computed: {}
  }
</script>

<style scoped>
  .form-item-panel {
    position: relative;
    padding: 10px 10px 10px 10px;
    background-color: #616161;
    border: 1px solid #212121;
    margin: 25px 0px 10px 0px;
    border-radius: 4px;
    font-size: 12px;
  }
  .title-wrapper {
    min-width: 80px;
    height: 20px;
    position: absolute;
    left: 5px;
    top: -20px;
    /*background-color: #616161;
    border: 1px solid #212121;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;*/
    line-height: 20px;
    font-size: 12px;
    text-align: center;
    padding: 0px 5px;
    border-bottom-color: #616161;
  }
</style>
